#pragma once
#ifndef __G_PARALLEL_FOR_INTERNAL_H__
#define __G_PARALLEL_FOR_INTERNAL_H__

#include "GTask.h"
#include "GTaskResult.h"
#include "GRange.h"
#include "GTypes.h"

namespace GEngine
{
	class GParallelForTask;

	class GParallelForInternal : public GTask
	{
	private:
		GTaskRange			Range;
		GParallelForTask*	Task;

	public:
							GParallelForInternal(GTaskResult* Result, GParallelForTask* ForTask, const GTaskRange& ForRange);
		virtual				~GParallelForInternal();

		virtual bool		Spread(GTaskQueue** QueueArr, GSize QueueCount);
		virtual bool		Reduce(OUTPUT GEngine::GTask** OutTask);
		virtual bool		Divide(OUTPUT GEngine::GTask** OutTask);

		virtual GUInt32		Execute(GSize WorkerId);
	
	};

}

#endif